const fs = require('fs');;

fs.readFile('./files/成绩.txt', 'utf-8', (error, data) => {
    const oldScore = data.split(' ');
    const newScore = [];
    oldScore.forEach(item => {
        newScore.push(item.replace('=', '：'));
    });
    console.log(newScore);
    const newStr = newScore.join('\r\n');
    console.log(newStr);
    fs.writeFile('./files/成绩New.txt', newStr, (error) => {
        if (error == null) {
            console.log('写入文件成功');
        } else {
            console.log('写入文件失败')
        }
    })
})